<template>
  <div class="container">
    <div class="speed-up"
         v-if="done_arr.length>0"
         v-for="(item, index) in done_arr||[]"
         :key="index">
      <div class="code clearfix">
        <div class="left">补贴单号：{{item.applySn}}</div>
        <div class="right">第{{item.allowanceNumFormat}}期</div>
      </div>
      <div class="status">
        <div class="progress">
          <div class="gray"></div>
          <div class="red"
               :style="{'width':'100%'}">
            <img :src="base_url+'/mp_3.1.1/bt/icon_tempo_money.png'"
                 class="rocket"
                 v-if="base_url"
                 alt="">
          </div>
        </div>
        <div class="total">
          {{item.allSpeedAchieve}}
        </div>
      </div>
      <div class="detail">
        <p class="tip">您已分享 <span class="num">￥ {{item.speedAchieve}}</span> ，您已完成本次第 <span class="num">{{item.allowanceNumFormat}}</span> 期提速，{{item.isOver==1?'已':'将'}}在 <span class="num">{{item.isOver==0&&item.suspend?'暂停结束后':item.applyMonth}}月</span> 所返积分中体现</p>
      </div>
    </div>

    <div class="empty"
         v-if="done_arr&&done_arr.length==0">
      <img :src="base_url+'/mp_3.1.1/bt/bg_nothing.png'"
           v-if="base_url"
           alt=""
           class="img">
      <div class="msg">您还没有加速单哦</div>
    </div>
  </div>
</template>

<script>
import common from '@/assets/js/mmk_common.js'
export default {
  data () {
    return {
      base_url: common.image_resource,
    }
  },
  methods: {

  },
  props: ["done_arr"]
}
</script>

<style lang="less" scoped>
.container {
  .speed-up {
    margin: 10px 10px 0;
    height: 146px;
    background: rgba(255, 255, 255, 1);
    border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    .code {
      vertical-align: middle;
      .left {
        float: left;
        font-size: 12px;
        font-family: "PingFangSC-Regular", "PingFang SC";
        font-weight: 400;
        color: rgba(153, 153, 153, 1);
        line-height: 16px;
      }
      .right {
        float: right;
        font-size: 12px;
        font-family: "PingFangSC-Regular", "PingFang SC";
        font-weight: 400;
        color: rgba(255, 56, 62, 1);
        line-height: 16px;
      }
    }
    .status {
      margin-top: 20px;
      display: flex;
      .progress {
        flex: 1;
        position: relative;
        .gray {
          width: 100%;
          height: 6px;
          background: rgba(235, 235, 235, 1);
          border-radius: 5px;
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
        }
        .red {
          height: 6px;
          background: rgba(255, 56, 62, 1);
          border-radius: 5px;
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
          .rocket {
            width: 20px;
            height: 20px;
            display: block;
            position: absolute;
            right: 0;
            top: 50%;
            transform: translate(0, -50%);
          }
          .current-total {
            background: rgba(255, 139, 139, 0.1);
            border-radius: 8px;
            font-size: 10px;
            padding: 0 4px;
            font-family: "PingFangSC-Regular", "PingFang SC";
            font-weight: 400;
            color: rgba(255, 56, 62, 1);
            line-height: 16px;
            position: absolute;
            right: 0;
            bottom: 0;
            transform: translate(10px, 25px);
          }
        }
      }
      .total {
        padding: 0 6px;
        height: 20px;
        background: rgba(255, 56, 62, 1);
        border-radius: 14px;
        font-size: 12px;
        font-family: "PingFangSC-Medium", "PingFang SC";
        font-weight: 500;
        color: rgba(255, 255, 255, 1);
        line-height: 20px;
        margin-left: 10px;
      }
    }
    .detail {
      margin-top: 23px;
      .tip {
        font-size: 12px;
        font-family: "PingFangSC-Regular", "PingFang SC";
        font-weight: 400;
        color: rgba(113, 113, 113, 1);
        line-height: 17px;
        vertical-align: middle;
        .num {
          color: rgba(255, 56, 62, 1);
          display: inline-block;
        }
      }
    }
    .btn {
      width: 85px;
      height: 32px;
      background: linear-gradient(
        181deg,
        rgba(249, 224, 194, 1) 0%,
        rgba(240, 182, 125, 1) 100%
      );
      border-radius: 16px 0px 0px 16px;
      position: absolute;
      bottom: 10px;
      right: 0;
      font-size: 14px;
      font-family: "PingFangSC-Medium", "PingFang SC";
      font-weight: 500;
      color: rgba(66, 30, 30, 1);
      line-height: 32px;
      padding-left: 13px;

      .icon {
        width: 16px;
        height: 16px;
        display: inline-block;
        vertical-align: middle;
        margin-left: 6px;
      }
    }
  }
  .empty {
    .img {
      display: block;
      margin: 168px auto 0;
      width: 170px;
      height: 170px;
    }
    .msg {
      font-size: 12px;
      font-family: "PingFangSC-Regular", "PingFang SC";
      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 17px;
      margin-top: 10px;
      text-align: center;
      margin-bottom: 80px;
    }
  }
}
</style>